import { createStore } from 'vuex'

export default createStore({
  state: {
      id:1,
      count: 1,
      username:'xiaoming',
      age:'18',
      list:[],
    
  },
  mutations: {
    countjia(){
      this.state.count +=1;
    },
    addUser(state,value){
      state.list.unshift(value);
      }
    
  },
  actions: {
    countjia(){
      this.commit('countjia'),
      console.log('action zhong countjia bei diaoyong');
    },
    addUser(store,value){
      store.commit('addUser',value);
    },
  },
  modules: {
  }
})
